/*******************************************************************************
 * 文件名: Pager.java
 * 描    述: 分页对象类
 * 创建人: Dean Huang(hudi-112@163.com)
 * 日　期: 2017-12-22
 * 描　述: 文件描述
 * 版　本: 1.0
 *******************************************************************************/

package com.z1.core.web.model;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

@JsonIgnoreProperties(ignoreUnknown=true)
@JsonInclude(Include.NON_NULL) 
public class Pager<T> {

	public static final int QUERY_PAGE_SIZE = 10;
	
	//总条数
	private long total = 0L;
	//当前页记录
	private List<T> rows;
	
	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}
	public Pager<T> total(long total) {
		this.setTotal(total);
		return this;
	}
	
	public List<T> getRows() {
		if (null == rows) {
			rows = new ArrayList<T>();
		}
		return rows;
	}
	public void setRows(List<T> rows) {
		this.rows = rows;
	}
	public Pager<T> rows(List<T> rows) {
		this.setRows(rows);
		return this;
	}
	
}
